From: Florian Müllner Date: Fri, 11 Oct 2024 12:30:44 +0000 (+0200) Subject: status/keyboard: Always released held keyboard after activating source X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~194^2^2~13 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=06ef8365ceb198197e9c4e6c5c455c7c35165213;p=gnome-shell.git status/keyboard: Always released held keyboard after activating source As the keyboard is released asynchronously after setting the ibus engine, there's a possibility that the `this._reloading` property changed in the meantime. To ensure that `holdKeyboard()` and `releaseKeyboard()` are correctly paired, record the condition in a local variable so that it maintains its value in the callback. Part-of: (cherry picked from commit fb58ceb4c5cf1ce60666229df25f4bbdb4934789) --- diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index 3be8f2cba..c0153ef8d 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -503,7 +503,8 @@ export class InputSourceManager extends Signals.EventEmitter { // E.g. Focusing on a password entry in a popup in Xorg Firefox // will emit 'set-content-type' signal. // https://gitlab.gnome.org/GNOME/gnome-shell/issues/391 - if (!this._reloading) + const holdKeyboard = !this._reloading; + if (holdKeyboard) KeyboardManager.holdKeyboard(); this._keyboardManager.apply(is.xkbId); @@ -520,7 +521,7 @@ export class InputSourceManager extends Signals.EventEmitter { engine = 'xkb:us::eng'; this._ibusManager.setEngine(engine).then(() => { - if (!this._reloading) + if (holdKeyboard) KeyboardManager.releaseKeyboard(); });